import service from "@/api/index.js";
import qs from 'qs';

const AdminApi= {
   //验证码
    captcha(){
        return service.get("/admin/captcha");
    },
    insert(admin){
        return service.post("/admin/insert",admin)
    }
    ,
    //登录
    login(admin){
        return service.post("admin/login",qs.stringify(admin));
    },
    getInfo(){
      return service.get("admin/info")
    },
    chgPwd(chgPwdObj){

      return service.put("/admin/chgPwd",qs.stringify(chgPwdObj));
    }
    ,
    chgInfo(admin){
        return service.put("/admin/chgInfo",admin)
    }, //分页搜索
    selectByPage(condition,pageNum,pageSize){
        condition.pageNum = pageNum;
        condition.pageSize = pageSize;
        return service.get("/admin/All",{
            params: condition
        })
    },
    updateStatus(id){
        return  service.put(`/admin/${id}`);
    },
    updatePwd(id){
        return  service.put(`/admin/pwd/${id}`)
    }
};
export default AdminApi;